<?php
session_start();

function is_login() {
	return !empty($_SESSION['user']) && $_SESSION['user'] == 'admin';
}

/**
 * 登陆
 * @param  [type] $user     登录用户
 * @param  [type] $password 登录密码
 * @return [type]           [description]
 */
function login($user, $password) {
	if (!empty($user) && !empty($password)) {
		if ($user =='admin' && $password == "admin") {
			$_SESSION['user'] = 'admin';
			return true;
		}
	}
	return false;
}
function logout() {
	unset($_SESSION['user']);
}
?>
